package net.adetech.crj.controller;

import com.alibaba.fastjson.JSON;
import net.adetech.crj.entity.Hall;
import net.adetech.crj.utils.ServiceUtil;
import net.adetech.framework.entity.ServiceResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HallServiceController {

    @Autowired
    ServiceUtil serviceUtil;
    @RequestMapping("/hall/getListByServiceType")
    public String getHallListByServiceType(String serviceType)
    {
        ServiceResponse response = serviceUtil.callService("hall.getListByServiceType","serviceType",serviceType);
        List<Hall>  hallList = (List<Hall>)response.getResults().get("hallList");
        return JSON.toJSONString(hallList);
    }
}
